package com.tyut.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tyut.entity.User;
import io.minio.errors.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author 山田凉
 * @since 2025-03-18
 */
public interface UserService extends IService<User> {

    IPage<User> list(Integer pageNo , Integer pageSize ,String username , Integer role);

    boolean check(String fieldName, String value ,Integer id);

    String login(String username , String password);

    boolean register(User user);

    boolean forget(String username,  String phone , String password);

    List<User> getActive();

    User getUserMessage(Integer id);

    String updateIcon(MultipartFile file ,Integer id ) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

    boolean updateUsername(String username , Integer id);

    boolean updatePassword(String oldPsw, String newPsw , Integer id);

    boolean updatePhone(String phone , Integer id);

    boolean updateEmail(String email , Integer id);

    IPage<User> getApply(Integer pageNo , Integer pageSize);

}
